Do not call interpolated in `working?`

It is dangerous to call `interpolated` in `working?` because
interpolating without a running context like an incoming event may raise
an error.

Also, `expected_update_period_in_days` is not supposed to be
interpolated.

This is related to #881.

Akinori MUSHA 9 years ago
parent
commit
c1a5f1ef11
1 changed files with 1 additions and 1 deletions
  1. 1 1
      app/models/agents/website_agent.rb

+ 1 - 1
app/models/agents/website_agent.rb

@@ -116,7 +116,7 @@ module Agents
116 116
     end
117 117
 
118 118
     def working?
119
-      event_created_within?(interpolated['expected_update_period_in_days']) && !recent_error_logs?
119
+      event_created_within?(options['expected_update_period_in_days']) && !recent_error_logs?
120 120
     end
121 121
 
122 122
     def default_options